<template>
  <div class="order">
    <div class="router">
      <div class="route" v-for="(item,index) in routeList" :key="index">
        <div class="router-view" @click="toPath($event,item.url)" v-if="index === 0">
          <img class="back" id="back" src="../../assets/zhome/back.png" alt />
          <span class="border"></span>
          <img class="back" src="../../assets/zhome/home.png" alt />
          <span class="title">{{ item.title }}</span>
        </div>
        <div class="router-next" v-else>
          <span class="bor"></span>
          <span class="title">{{ item.title }}</span>
        </div>
        <img
          v-if="index !== routeList.length - 1"
          class="icon-right"
          src="../../assets/zhome/right.png"
          alt
        />
      </div>
    </div>
    <div class="image">
      <div>
        <span>AI赋能</span>工具·让创新更简单
      </div>
      <div>知产宝2024人工智能研讨会</div>
    </div>
    <div class="card">
      <div class="views">
        <div class="title">知产宝专业版</div>
        <div class="list">
          <div v-for="(item,index) in list" :key="index">
            <img src="../../assets/zhome/gouxuan.png" alt />
            {{ item.title }}
          </div>
        </div>
      </div>
      <div class="time">
        <div class="time-title">订购时长</div>
        <div class="time-list">
          <div
            class="view"
            :class="timeIndex === index ? 'select':''"
            v-for="(item,index) in timeList"
            :key="index"
            @click="timeIndex = index"
          >
            <div class="times">{{ item.time }}</div>
            <div class="div">
              <span>¥</span>
              <span>{{ item.price}}</span>
              {{ item.unit }}
            </div>
          </div>
        </div>
      </div>
      <div class="btn">
        <el-button color="#0052D9" type="primary">立即订购</el-button>
      </div>
    </div>
  </div>
</template>
<script setup>
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
let routeList = ref([{ title: "首页", url: "/home" }, { title: "在线订购" }]);
let list = ref([
  { title: "全球170个国家1.8亿+件专利" },
  { title: "支持语义检索、AI检索、图形检索等智能检索方式" },
  { title: "自动监视新专利和专利状态变化" },
  { title: "支持中文检索全球专利" },
  { title: "支持专业的逻辑检索" },
  { title: "支持统计分析、聚类分析、3D沙盘分析" },
  { title: "400+检索维度" },
  { title: "在线建立专题数据库，灵活标引和分享" },
  { title: "专利转让、许可、质押等运营信息" },
  { title: "专利诉讼、复审无效等法律信息" },
  { title: "标准声明专利、海关备案等关联信息" }
]);
let timeList = ref([
  { time: "7天", price: 1800, unit: "周" },
  { time: "包月", price: 4800, unit: "月" },
  { time: "包年", price: 28800, unit: "年" }
]);
let timeIndex = ref(0);

const back = () => {
  router.go(-1);
};

const toPath = (e, url) => {
  let id = e.target.id;
  console.log(id);
  if (id === "back") {
    back();
    return;
  }
  router.push(url);
};
</script>
<style lang="scss" scoped>
.order {
  padding: 10px 240px;
  .btn {
    display: flex;
    justify-content: flex-end;
    .el-button--primary {
      width: 160px;
      height: 48px;
      border-radius: 2px;
    }
  }
  .time {
    display: flex;
    padding-top: 20px;
    &-list {
      display: flex;
      .view {
        width: 180px;
        height: 106px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid #d6dce0;
        border-radius: 2px;
        margin-left: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        .div {
          margin-top: 20px;
          font-size: 14px;
          font-family: PingFang SC, PingFang SC-Regular;
          font-weight: 400;
          text-align: left;
          color: #646770;
          line-height: 22px;
          span:first-of-type {
            font-size: 16px;
            font-family: PingFang SC, PingFang SC-Semibold;
            font-weight: 600;
            text-align: left;
            color: #202020;
            line-height: 22px;
          }
          span:nth-of-type(2) {
            font-size: 24px;
            font-family: PingFang SC, PingFang SC-Semibold;
            font-weight: 600;
            text-align: left;
            color: #202020;
            line-height: 22px;
          }
        }
        .times {
          font-size: 16px;
          font-family: PingFang SC, PingFang SC-Semibold;
          font-weight: 600;
          text-align: left;
          color: #202020;
          line-height: 22px;
        }
      }
      .select {
        background: #ebf2fc;
        border: 1px solid #0052d9;
        .div {
          color: #0052d9;
          span {
            color: #0052d9;
          }
          span:first-of-type {
            color: #0052d9;
          }
          span:nth-of-type(2) {
            color: #0052d9;
          }
        }
        .times {
          color: #0052d9;
        }
      }
    }
    &-title {
      font-size: 16px;
      font-family: PingFang SC, PingFang SC-Semibold;
      font-weight: 600;
      text-align: left;
      color: #202020;
      line-height: 22px;
    }
  }
  .card {
    padding: 20px 20px 30px;
    background-color: white;
    border: 2px solid #ffffff;
    border-radius: 4px;
    .views {
      padding: 38px 32px 10px;
      background: rgba(255, 255, 255, 0.7);
      border: 1px solid #d6dce0;
      border-radius: 2px;
      .list {
        display: flex;
        flex-wrap: wrap;
        div {
          width: 33%;
          flex-shrink: 0;
          padding-bottom: 28px;
          font-size: 14px;
          font-family: PingFang SC, PingFang SC-Regular;
          font-weight: 400;
          text-align: left;
          color: #202020;
          line-height: 22px;
          display: flex;
          align-items: center;
          img {
            width: 16px;
            height: 16px;
            margin-right: 10px;
          }
        }
      }
      .title {
        text-align: center;
        font-size: 24px;
        font-family: PingFang SC, PingFang SC-Semibold;
        font-weight: 600;
        color: #202020;
        line-height: 22px;
        margin-bottom: 37px;
      }
    }
  }
  .image {
    height: 140px;
    background: url("../../assets/zhome/order.png") no-repeat;
    background-size: 100% 100%;
    margin: 10px 0 20px;
    padding: 0 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    div {
      font-size: 14px;
      font-family: PingFang SC, PingFang SC-Regular;
      font-weight: Regular;
      text-align: left;
      color: #575966;
      line-height: 20px;
    }
    div:first-of-type {
      font-size: 26px;
      font-family: PingFang SC, PingFang SC-Medium;
      font-weight: 500;
      text-align: left;
      line-height: 37px;
      color: #202020;
      margin-bottom: 10px;
      span {
        color: #0052d9;
      }
    }
  }
  .router {
    display: flex;
    .title {
      font-size: 12px;
      font-family: PingFang SC, PingFang SC-Regular;
      font-weight: 400;
      text-align: left;
      color: #575966;
    }
    .route {
      display: flex;
      align-items: center;
      .icon-right {
        width: 10px;
        height: 10px;
        margin: 0 10px;
      }
    }
    &-next {
      padding: 0 12px;
      height: 32px;
      background: #ffffff;
      border-radius: 2px;
      display: flex;
      align-items: center;
      cursor: pointer;
      .bor {
        width: 6px;
        height: 6px;
        background: #0052d9;
        border-radius: 3px;
        margin-right: 10px;
      }
    }
    &-view {
      padding: 0 12px;
      height: 32px;
      background: #ffffff;
      border-radius: 2px;
      display: flex;
      align-items: center;
      cursor: pointer;
      .border {
        width: 1px;
        height: 10px;
        background: #d8d8d8;
        margin: 0 12px;
      }
      .title {
        margin-left: 10px;
      }
      .back {
        width: 14px;
        height: 14px;
      }
    }
  }
}
</style>